package com.wc.blue_bridge_history.JavaLast.I_GCD王国和LCM王国;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/4/7 20:59
 * @description https://www.lanqiao.cn/paper/3998/problem/3137/
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 100010;
    static int[] primes = new int[N];
    static boolean[] st = new boolean[N];
    static int[] a = new int[N];
    static Map<Integer, Integer> map = new HashMap<>();
    static int n, idx = 0;


    static void ola() {
        st[0] = st[1] = true;
        for (int i = 2; i < N; i++) {
            if (!st[i]) primes[++idx] = i;
            for (int j = 1; primes[j] < N / i; j++) {
                st[i * primes[j]] = true;
                if (i % primes[j] == 0) break;
            }
        }
    }

    public static void main(String[] args) {
        ola();
        n = sc.nextInt();
        for (int i = 1; i <= n; i++) a[i] = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            int num = a[i];
            for (int j = 1; primes[j] <= num / primes[j]; j++) {
                if (num % primes[j] == 0) {
                    int s = 0;
                    while (num % primes[j] == 0) {
                        s++;
                        num /= primes[j];
                    }
                    map.put(primes[j], map.getOrDefault(primes[j], 0) + s);
                }
            }
            if (num > 1) map.put(num, map.getOrDefault(num, 0) + 1);
        }
        int res = 1;
        for (int num : map.keySet()) {
            if (map.get(num) >= n) {
                res *= (int) Math.pow(num, (int) (map.get(num) / n));
            }
        }
        out.println(res);
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
